package cn.tedu.tmall.front.content.persist.respository.impl;

import cn.tedu.tmall.front.content.persist.mapper.CategoryMapper;
import cn.tedu.tmall.front.content.persist.respository.ICategoryRepository;
import cn.tedu.tmall.front.content.pojo.po.CategoryPO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class CategoryRepositoryImpl implements ICategoryRepository {


    /**
     * mybatis的方式
     */
    @Autowired
    private CategoryMapper categoryMapper;


    @Override
    public List<CategoryPO> listCategory() {
        QueryWrapper queryWrapper  = new QueryWrapper();
        List<CategoryPO> list = categoryMapper.selectList(queryWrapper);
        return list;
    }
}
